home *** CD-ROM | disk | FTP | other *** search
- function jump()
- {
- if(canjump == true and dead == false)
- {
- yinc = -17;
- inAir = true;
- canjump = false;
- acted = false;
- }
- }
- function moves()
- {
- if(dix == false and long >= -500 and dead == false)
- {
- this._x -= movspd;
- long -= movspd;
- this.gotoAndPlay("Φ╡░");
- this._xscale = 100;
- }
- else if(dix == true and long <= 500 and dead == false)
- {
- this._x += movspd;
- long += movspd;
- this.gotoAndPlay("Φ╡░");
- this._xscale = -100;
- }
- }
- stop();
- onEnterFrame = function()
- {
- if(_parent._parent.pauses == false)
- {
- if(acted == false and dead == false)
- {
- actnum = random(6);
- acted = true;
- }
- if(acted == true and dead == false)
- {
- act_i++;
- if(act_i >= 60)
- {
- act_i = 0;
- acted = false;
- }
- }
- switch(actnum)
- {
- case 0:
- jump();
- break;
- case 1:
- dix = null;
- moves();
- break;
- case 2:
- dix = false;
- moves();
- jump();
- break;
- case 3:
- dix = true;
- moves();
- jump();
- break;
- case 4:
- dix = false;
- moves();
- break;
- case 5:
- dix = true;
- moves();
- }
- var _loc4_ = 0;
- while(_loc4_ < _parent._parent.item_array.length)
- {
- var _loc3_ = _parent[_parent._parent.item_array[_loc4_]];
- if(this.hitTest(_loc3_) and dead == false)
- {
- delete _loc3_.onEnterFrame;
- _loc3_.manhit = false;
- _loc3_.play();
- }
- _loc4_ = _loc4_ + 1;
- }
- _loc4_ = 0;
- while(_loc4_ < _parent._parent.land_array.length)
- {
- var _loc6_ = _parent[_parent._parent.land_array[_loc4_]];
- if(this.qfk.hitTest(_loc6_) and _loc6_.noWalk == true)
- {
- if(movRight == true)
- {
- this._x += movspd;
- }
- if(movLeft == true)
- {
- this._x -= movspd;
- }
- }
- _loc4_ = _loc4_ + 1;
- }
- if(inAir == true)
- {
- if(yinc < 15)
- {
- yinc += g;
- }
- this._y += yinc;
- _loc4_ = 0;
- while(_loc4_ < _parent._parent.land_array.length)
- {
- landObject = _parent[_parent._parent.land_array[_loc4_]];
- var _loc5_ = landObject.getBounds(_parent).yMin;
- if(this.dfk.hitTest(landObject))
- {
- if(this._y - yinc < _loc5_)
- {
- inAir = false;
- this._y = _loc5_;
- yinc = 0;
- canjump = true;
- break;
- }
- }
- _loc4_ = _loc4_ + 1;
- }
- }
- }
- };
-